﻿<UserControl x:Class="Schedulr.Plugins.ResizePicture.ResizePicturePluginSettingsControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Grid.Column="0" Content="Resize so that the longest side is maximum" VerticalAlignment="Center" Margin="0,0,5,0" />
        <ComboBox Grid.Row="0" Grid.Column="1" x:Name="longestSideComboBox" />
        <Border Grid.Row="1" Grid.Column="0">
            <Border.Style>
                <Style TargetType="Border">
                    <Setter Property="Visibility" Value="Collapsed" />
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=longestSideComboBox, Path=SelectedItem.IsCustom}" Value="True">
                            <Setter Property="Visibility" Value="Visible" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Border.Style>
            <Label Content="Custom size" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,5,5,0" />
        </Border>
        <Border Grid.Row="1" Grid.Column="1">
            <Border.Style>
                <Style TargetType="Border">
                    <Setter Property="Visibility" Value="Collapsed" />
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=longestSideComboBox, Path=SelectedItem.IsCustom}" Value="True">
                            <Setter Property="Visibility" Value="Visible" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Border.Style>
            <TextBox Text="{Binding Path=LongestSide, Mode=TwoWay}" Margin="0,5,0,0" />
        </Border>
    </Grid>
</UserControl>